#include <iostream>
#include <string>
using namespace std;

int main()
{
    string str;
    getline(cin, str);

    int right = 0, left = 0, n = str.size();
    string ans("");
    for (right = 0; right < n; right++)
    {
        while (right < n && (str[right] >= '0' && str[right] <= '9'))
        {
            right++;
        }

        if ((int)ans.size() < (right - left - 1))
        {
            std::string::iterator it = str.begin();
            ans.clear();
            ans.append(it + left + 1, it + right);
        }
        left = right;
    }

    cout << ans << endl;
    return 0;
}


//
#include <vector>

class Solution {
public:
    int MoreThanHalfNum_Solution(vector<int>& numbers) {
        int ans = numbers[0], count = 1;
        for (int i = 1; i < numbers.size(); i++)
        {
            if (ans != numbers[i])
                count--;
            else
                count++;

            if (count == 0)
            {
                ans = numbers[++i];
                count = 1;
            }
        }

        return ans;
    }
};